summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2013-12-18 16:25:09 +0000
committerTorne (Richard Coles) <torne@google.com>2013-12-18 16:25:09 +0000
commita3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7 (patch)
treedafc1c6417406a7fbd422ad0bb890e96909ef564 /extensions
parentd5f893c0bc79db3066bb5ae5d3d972ba1be7dd5f (diff)
downloadchromium_org-a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7.tar.gz
Merge from Chromium at DEPS revision 240154
This commit was generated by merge_to_master.py. Change-Id: I8f2ba858cf0e7f413dddedc2ae91dc37f7136c2e
Diffstat (limited to 'extensions')
-rw-r--r--extensions/browser/app_sorting.h4
-rw-r--r--extensions/browser/extension_function.cc5
-rw-r--r--extensions/browser/extensions_browser_client.h12
-rw-r--r--extensions/browser/file_highlighter_unittest.cc14
-rw-r--r--extensions/browser/process_manager.cc122
-rw-r--r--extensions/browser/process_manager.h24
-rw-r--r--extensions/browser/update_observer.h27
-rw-r--r--extensions/common/constants.h11
-rw-r--r--extensions/common/extension.cc5
-rw-r--r--extensions/common/extension_resource_unittest.cc8
-rw-r--r--extensions/common/file_util_unittest.cc4
-rw-r--r--extensions/common/manifest_handlers/csp_info.cc2
-rw-r--r--extensions/common/permissions/api_permission.h4
-rw-r--r--extensions/common/switches.cc6
-rw-r--r--extensions/common/url_pattern.cc2
-rw-r--r--extensions/extensions.gyp1
16 files changed, 164 insertions, 87 deletions
diff --git a/extensions/browser/app_sorting.h b/extensions/browser/app_sorting.h
index 6efa5e425f..967fb46eea 100644
--- a/extensions/browser/app_sorting.h
+++ b/extensions/browser/app_sorting.h
@@ -8,15 +8,15 @@
#include <string>
#include "base/basictypes.h"
-#include "chrome/browser/extensions/extension_prefs.h"
#include "extensions/common/extension.h"
#include "sync/api/string_ordinal.h"
-class ExtensionScopedPrefs;
class ExtensionSyncService;
namespace extensions {
+class ExtensionScopedPrefs;
+
// An interface that provides a fixed ordering for a set of apps.
class AppSorting {
public:
diff --git a/extensions/browser/extension_function.cc b/extensions/browser/extension_function.cc
index 9d7142e7ca..a06d2c496d 100644
--- a/extensions/browser/extension_function.cc
+++ b/extensions/browser/extension_function.cc
@@ -5,7 +5,7 @@
#include "extensions/browser/extension_function.h"
#include "base/logging.h"
-#include "base/metrics/histogram.h"
+#include "base/metrics/sparse_histogram.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/renderer_host/chrome_render_message_filter.h"
@@ -114,8 +114,7 @@ void ExtensionFunction::SetError(const std::string& error) {
}
void ExtensionFunction::Run() {
- UMA_HISTOGRAM_ENUMERATION("Extensions.FunctionCalls", histogram_value(),
- extensions::functions::ENUM_BOUNDARY);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls", histogram_value());
if (!RunImpl())
SendResponse(false);
diff --git a/extensions/browser/extensions_browser_client.h b/extensions/browser/extensions_browser_client.h
index 6331dae5c2..61641a7931 100644
--- a/extensions/browser/extensions_browser_client.h
+++ b/extensions/browser/extensions_browser_client.h
@@ -7,6 +7,9 @@
#include "base/memory/scoped_ptr.h"
+class CommandLine;
+class PrefService;
+
namespace content {
class BrowserContext;
}
@@ -28,6 +31,11 @@ class ExtensionsBrowserClient {
// Returns true if the embedder has started shutting down.
virtual bool IsShuttingDown() = 0;
+ // Returns true if extensions have been disabled (e.g. via a command-line flag
+ // or preference).
+ virtual bool AreExtensionsDisabled(const CommandLine& command_line,
+ content::BrowserContext* context) = 0;
+
// Returns true if the |context| is known to the embedder.
virtual bool IsValidContext(content::BrowserContext* context) = 0;
@@ -51,6 +59,10 @@ class ExtensionsBrowserClient {
virtual content::BrowserContext* GetOriginalContext(
content::BrowserContext* context) = 0;
+ // Returns the PrefService associated with |context|.
+ virtual PrefService* GetPrefServiceForContext(
+ content::BrowserContext* context) = 0;
+
// Returns true if loading background pages should be deferred.
virtual bool DeferLoadingBackgroundHosts(
content::BrowserContext* context) const = 0;
diff --git a/extensions/browser/file_highlighter_unittest.cc b/extensions/browser/file_highlighter_unittest.cc
index a449bf903c..f419109577 100644
--- a/extensions/browser/file_highlighter_unittest.cc
+++ b/extensions/browser/file_highlighter_unittest.cc
@@ -49,7 +49,7 @@ TEST(ManifestHighlighterUnitTest, ManifestHighlighterUnitTest) {
" /* This is a tricky comment because it has brackets }]*/\n"
" \"tabs\"\n"
" ]";
- ManifestHighlighter permissions(kManifest, "permissions", EmptyString());
+ ManifestHighlighter permissions(kManifest, "permissions", std::string());
EXPECT_EQ(kPermissionsFeature, permissions.GetFeature());
// Get a specific portion of a key.
@@ -70,14 +70,14 @@ TEST(ManifestHighlighterUnitTest, ManifestHighlighterUnitTest) {
EXPECT_EQ(kMatchesFeature, matches.GetFeature());
// If a feature isn't present, we should get an empty string.
- ManifestHighlighter not_present(kManifest, "a_fake_feature", EmptyString());
- EXPECT_EQ(EmptyString(), not_present.GetFeature());
+ ManifestHighlighter not_present(kManifest, "a_fake_feature", std::string());
+ EXPECT_EQ(std::string(), not_present.GetFeature());
// If we request a specific portion of a key which is not found, we should
// get an empty string.
ManifestHighlighter specific_portion_not_present(
kManifest, "permissions", "a_fake_feature");
- EXPECT_EQ(EmptyString(), specific_portion_not_present.GetFeature());
+ EXPECT_EQ(std::string(), specific_portion_not_present.GetFeature());
const char kEscapedQuotedFeature[] = "\"escaped_quoted\\\"\"";
ManifestHighlighter escaped_quoted(
@@ -91,7 +91,7 @@ TEST(ManifestHighlighterUnitTest, ManifestHighlighterUnitTest) {
// Check with non-ascii characters.
const char kInternationalFeature[] = "\"international_key\": \"還是不要\"";
ManifestHighlighter international_feature(
- kManifest, "international_key", EmptyString());
+ kManifest, "international_key", std::string());
EXPECT_EQ(kInternationalFeature, international_feature.GetFeature());
}
@@ -111,10 +111,10 @@ TEST(SouceHighlighterUnitTest, SourceHighlighterUnitTest) {
EXPECT_EQ(kNoNewlineSourceFile, full_line.GetFeature());
SourceHighlighter line_zero(kNoNewlineSourceFile, 0u);
- EXPECT_EQ(EmptyString(), line_zero.GetFeature());
+ EXPECT_EQ(std::string(), line_zero.GetFeature());
SourceHighlighter out_of_bounds(kNoNewlineSourceFile, 2u);
- EXPECT_EQ(EmptyString(), out_of_bounds.GetFeature());
+ EXPECT_EQ(std::string(), out_of_bounds.GetFeature());
}
} // namespace extensions
diff --git a/extensions/browser/process_manager.cc b/extensions/browser/process_manager.cc
index a1ee794ace..6a57d8e600 100644
--- a/extensions/browser/process_manager.cc
+++ b/extensions/browser/process_manager.cc
@@ -133,6 +133,10 @@ struct ProcessManager::BackgroundPageData {
// The count of things keeping the lazy background page alive.
int lazy_keepalive_count;
+ // Tracks if an impulse event has occured since the last polling check.
+ bool keepalive_impulse;
+ bool previous_keepalive_impulse;
+
// This is used with the ShouldSuspend message, to ensure that the extension
// remained idle between sending the message and receiving the ack.
int close_sequence_id;
@@ -147,7 +151,11 @@ struct ProcessManager::BackgroundPageData {
linked_ptr<base::ElapsedTimer> since_suspended;
BackgroundPageData()
- : lazy_keepalive_count(0), close_sequence_id(0), is_closing(false) {}
+ : lazy_keepalive_count(0),
+ keepalive_impulse(false),
+ previous_keepalive_impulse(false),
+ close_sequence_id(0),
+ is_closing(false) {}
};
//
@@ -167,7 +175,6 @@ ProcessManager* ProcessManager::Create(BrowserContext* context) {
ProcessManager::ProcessManager(BrowserContext* context,
BrowserContext* original_context)
: site_instance_(SiteInstance::Create(context)),
- defer_background_host_creation_(false),
startup_background_hosts_created_(false),
devtools_callback_(base::Bind(
&ProcessManager::OnDevToolsStateChanged,
@@ -197,22 +204,25 @@ ProcessManager::ProcessManager(BrowserContext* context,
}
event_page_idle_time_ = base::TimeDelta::FromSeconds(10);
- unsigned idle_time_sec = 0;
+ unsigned idle_time_msec = 0;
if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- extensions::switches::kEventPageIdleTime), &idle_time_sec)) {
- event_page_idle_time_ = base::TimeDelta::FromSeconds(idle_time_sec);
+ extensions::switches::kEventPageIdleTime), &idle_time_msec)) {
+ CHECK(idle_time_msec > 0); // OnKeepaliveImpulseCheck requires non zero.
+ event_page_idle_time_ = base::TimeDelta::FromMilliseconds(idle_time_msec);
}
event_page_suspending_time_ = base::TimeDelta::FromSeconds(5);
- unsigned suspending_time_sec = 0;
+ unsigned suspending_time_msec = 0;
if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
extensions::switches::kEventPageSuspendingTime),
- &suspending_time_sec)) {
+ &suspending_time_msec)) {
event_page_suspending_time_ =
- base::TimeDelta::FromSeconds(suspending_time_sec);
+ base::TimeDelta::FromMilliseconds(suspending_time_msec);
}
content::DevToolsManager::GetInstance()->AddAgentStateCallback(
devtools_callback_);
+
+ OnKeepaliveImpulseCheck();
}
ProcessManager::~ProcessManager() {
@@ -346,38 +356,38 @@ int ProcessManager::GetLazyKeepaliveCount(const Extension* extension) {
return background_page_data_[extension->id()].lazy_keepalive_count;
}
-int ProcessManager::IncrementLazyKeepaliveCount(const Extension* extension) {
+void ProcessManager::IncrementLazyKeepaliveCount(const Extension* extension) {
if (!BackgroundInfo::HasLazyBackgroundPage(extension))
- return 0;
+ return;
int& count = background_page_data_[extension->id()].lazy_keepalive_count;
if (++count == 1)
OnLazyBackgroundPageActive(extension->id());
-
- return count;
}
-int ProcessManager::DecrementLazyKeepaliveCount(const Extension* extension) {
+void ProcessManager::DecrementLazyKeepaliveCount(const Extension* extension) {
if (!BackgroundInfo::HasLazyBackgroundPage(extension))
- return 0;
+ return;
+ DecrementLazyKeepaliveCount(extension->id());
+}
- int& count = background_page_data_[extension->id()].lazy_keepalive_count;
+void ProcessManager::DecrementLazyKeepaliveCount(
+ const std::string& extension_id) {
+ int& count = background_page_data_[extension_id].lazy_keepalive_count;
DCHECK_GT(count, 0);
// If we reach a zero keepalive count when the lazy background page is about
// to be closed, incrementing close_sequence_id will cancel the close
// sequence and cause the background page to linger. So check is_closing
// before initiating another close sequence.
- if (--count == 0 && !background_page_data_[extension->id()].is_closing) {
+ if (--count == 0 && !background_page_data_[extension_id].is_closing) {
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&ProcessManager::OnLazyBackgroundPageIdle,
- weak_ptr_factory_.GetWeakPtr(), extension->id(),
- ++background_page_data_[extension->id()].close_sequence_id),
+ weak_ptr_factory_.GetWeakPtr(), extension_id,
+ ++background_page_data_[extension_id].close_sequence_id),
event_page_idle_time_);
}
-
- return count;
}
void ProcessManager::IncrementLazyKeepaliveCountForView(
@@ -394,6 +404,51 @@ void ProcessManager::IncrementLazyKeepaliveCountForView(
}
}
+// This implementation layers on top of the keepalive count. An impulse sets
+// a per extension flag. On a regular interval that flag is checked. Changes
+// from the flag not being set to set cause an IncrementLazyKeepaliveCount.
+void ProcessManager::KeepaliveImpulse(const Extension* extension) {
+ if (!BackgroundInfo::HasLazyBackgroundPage(extension))
+ return;
+
+ BackgroundPageData& bd = background_page_data_[extension->id()];
+
+ if (!bd.keepalive_impulse) {
+ bd.keepalive_impulse = true;
+ if (!bd.previous_keepalive_impulse) {
+ IncrementLazyKeepaliveCount(extension);
+ }
+ }
+}
+
+// DecrementLazyKeepaliveCount is called when no calls to KeepaliveImpulse
+// have been made for at least event_page_idle_time_. In the best case an
+// impulse was made just before being cleared, and the decrement will occur
+// event_page_idle_time_ later, causing a 2 * event_page_idle_time_ total time
+// for extension to be shut down based on impulses. Worst case is an impulse
+// just after a clear, adding one check cycle and resulting in 3x total time.
+void ProcessManager::OnKeepaliveImpulseCheck() {
+ for (BackgroundPageDataMap::iterator i = background_page_data_.begin();
+ i != background_page_data_.end();
+ ++i) {
+ if (i->second.previous_keepalive_impulse && !i->second.keepalive_impulse)
+ DecrementLazyKeepaliveCount(i->first);
+
+ i->second.previous_keepalive_impulse = i->second.keepalive_impulse;
+ i->second.keepalive_impulse = false;
+ }
+
+ // OnKeepaliveImpulseCheck() is always called in constructor, but in unit
+ // tests there will be no message loop. In that event don't schedule tasks.
+ if (base::MessageLoop::current()) {
+ base::MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&ProcessManager::OnKeepaliveImpulseCheck,
+ weak_ptr_factory_.GetWeakPtr()),
+ event_page_idle_time_);
+ }
+}
+
void ProcessManager::OnLazyBackgroundPageIdle(const std::string& extension_id,
int sequence_id) {
ExtensionHost* host = GetBackgroundHostForExtension(extension_id);
@@ -480,16 +535,6 @@ void ProcessManager::CancelSuspend(const Extension* extension) {
}
}
-void ProcessManager::DeferBackgroundHostCreation(bool defer) {
- bool previous = defer_background_host_creation_;
- defer_background_host_creation_ = defer;
-
- // If we were deferred, and we switch to non-deferred, then create the
- // background hosts.
- if (previous && !defer_background_host_creation_)
- CreateBackgroundHostsForProfileStartup();
-}
-
void ProcessManager::OnBrowserWindowReady() {
ExtensionService* service = ExtensionSystem::GetForBrowserContext(
GetBrowserContext())->extension_service();
@@ -512,6 +557,12 @@ void ProcessManager::Observe(int type,
switch (type) {
case chrome::NOTIFICATION_EXTENSIONS_READY:
case chrome::NOTIFICATION_PROFILE_CREATED: {
+ // Don't load background hosts now if the loading should be deferred.
+ // Instead they will be loaded when a browser window for this profile
+ // (or an incognito profile from this profile) is ready.
+ if (DeferLoadingBackgroundHosts())
+ break;
+
CreateBackgroundHostsForProfileStartup();
break;
}
@@ -643,13 +694,6 @@ void ProcessManager::CreateBackgroundHostsForProfileStartup() {
if (startup_background_hosts_created_)
return;
- // Don't load background hosts now if the loading should be deferred.
- // Instead they will be loaded when a browser window for this profile
- // (or an incognito profile from this profile) is ready, or when
- // DeferBackgroundHostCreation is called with false.
- if (DeferLoadingBackgroundHosts())
- return;
-
ExtensionService* service = ExtensionSystem::GetForBrowserContext(
GetBrowserContext())->extension_service();
DCHECK(service);
@@ -749,10 +793,6 @@ void ProcessManager::ClearBackgroundPageData(const std::string& extension_id) {
}
bool ProcessManager::DeferLoadingBackgroundHosts() const {
- // Don't load background hosts now if the loading should be deferred.
- if (defer_background_host_creation_)
- return true;
-
// The extensions embedder may have special rules about background hosts.
return ExtensionsBrowserClient::Get()->DeferLoadingBackgroundHosts(
GetBrowserContext());
diff --git a/extensions/browser/process_manager.h b/extensions/browser/process_manager.h
index 669ebe7855..fa5f2b6502 100644
--- a/extensions/browser/process_manager.h
+++ b/extensions/browser/process_manager.h
@@ -86,12 +86,17 @@ class ProcessManager : public content::NotificationObserver {
// When this reaches 0, we will begin the process of shutting down the page.
// "Things" include pending events, resource loads, and API calls.
int GetLazyKeepaliveCount(const Extension* extension);
- int IncrementLazyKeepaliveCount(const Extension* extension);
- int DecrementLazyKeepaliveCount(const Extension* extension);
+ void IncrementLazyKeepaliveCount(const Extension* extension);
+ void DecrementLazyKeepaliveCount(const Extension* extension);
void IncrementLazyKeepaliveCountForView(
content::RenderViewHost* render_view_host);
+ // Keeps a background page alive. Unlike IncrementLazyKeepaliveCount, these
+ // impulses will only keep the page alive for a limited amount of time unless
+ // called regularly.
+ void KeepaliveImpulse(const Extension* extension);
+
// Handles a response to the ShouldSuspend message, used for lazy background
// pages.
void OnShouldSuspendAck(const std::string& extension_id, int sequence_id);
@@ -108,11 +113,6 @@ class ProcessManager : public content::NotificationObserver {
// onSuspendCanceled() event to it.
void CancelSuspend(const Extension* extension);
- // If |defer| is true background host creation is to be deferred until this is
- // called again with |defer| set to false, at which point all deferred
- // background hosts will be created. Defaults to false.
- void DeferBackgroundHostCreation(bool defer);
-
// Ensures background hosts are loaded for a new browser window.
void OnBrowserWindowReady();
@@ -164,6 +164,13 @@ class ProcessManager : public content::NotificationObserver {
// Close the given |host| iff it's a background page.
void CloseBackgroundHost(ExtensionHost* host);
+ // Internal implementation of DecrementLazyKeepaliveCount with an
+ // |extension_id| known to have a lazy background page.
+ void DecrementLazyKeepaliveCount(const std::string& extension_id);
+
+ // Checks if keepalive impulses have occured, and adjusts keep alive count.
+ void OnKeepaliveImpulseCheck();
+
// These are called when the extension transitions between idle and active.
// They control the process of closing the background page when idle.
void OnLazyBackgroundPageIdle(const std::string& extension_id,
@@ -203,9 +210,6 @@ class ProcessManager : public content::NotificationObserver {
// sending a Suspend message; read from command-line switch.
base::TimeDelta event_page_suspending_time_;
- // If true, then creation of background hosts is suspended.
- bool defer_background_host_creation_;
-
// True if we have created the startup set of background hosts.
bool startup_background_hosts_created_;
diff --git a/extensions/browser/update_observer.h b/extensions/browser/update_observer.h
new file mode 100644
index 0000000000..68c6e22368
--- /dev/null
+++ b/extensions/browser/update_observer.h
@@ -0,0 +1,27 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_BROWSER_UPDATE_OBSERVER_H_
+#define EXTENSIONS_BROWSER_UPDATE_OBSERVER_H_
+
+#include <string>
+
+namespace extensions {
+class Extension;
+
+class UpdateObserver {
+ public:
+ // Invoked when an app update is available.
+ virtual void OnAppUpdateAvailable(const Extension* extension) = 0;
+
+ // Invoked when Chrome update is available.
+ virtual void OnChromeUpdateAvailable() = 0;
+
+ protected:
+ virtual ~UpdateObserver() {}
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_UPDATE_OBSERVER_H_
diff --git a/extensions/common/constants.h b/extensions/common/constants.h
index 6f4e803294..3113a17e9f 100644
--- a/extensions/common/constants.h
+++ b/extensions/common/constants.h
@@ -83,17 +83,6 @@ extern const char kStateStoreName[];
// rules are stored.
extern const char kRulesStoreName[];
-// Don't remove items or change the order of this enum. It's used in
-// histograms and preferences.
-enum LaunchContainer {
- LAUNCH_WINDOW,
- LAUNCH_PANEL,
- LAUNCH_TAB,
- // For platform apps, which don't actually have a container (they just get a
- // "onLaunched" event).
- LAUNCH_NONE
-};
-
} // namespace extensions
#endif // EXTENSIONS_COMMON_CONSTANTS_H_
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
index 10e065b97f..0a67983d3a 100644
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -248,7 +248,10 @@ bool Extension::ParsePEMKeyBytes(const std::string& input,
// static
bool Extension::ProducePEM(const std::string& input, std::string* output) {
DCHECK(output);
- return (input.length() == 0) ? false : base::Base64Encode(input, output);
+ if (input.empty())
+ return false;
+ base::Base64Encode(input, output);
+ return true;
}
// static
diff --git a/extensions/common/extension_resource_unittest.cc b/extensions/common/extension_resource_unittest.cc
index fea3f4d5ac..499ba92496 100644
--- a/extensions/common/extension_resource_unittest.cc
+++ b/extensions/common/extension_resource_unittest.cc
@@ -50,9 +50,9 @@ TEST(ExtensionResourceTest, ResourcesOutsideOfPath) {
ASSERT_TRUE(temp.CreateUniqueTempDir());
base::FilePath inner_dir = temp.path().AppendASCII("directory");
- ASSERT_TRUE(file_util::CreateDirectory(inner_dir));
+ ASSERT_TRUE(base::CreateDirectory(inner_dir));
base::FilePath sub_dir = inner_dir.AppendASCII("subdir");
- ASSERT_TRUE(file_util::CreateDirectory(sub_dir));
+ ASSERT_TRUE(base::CreateDirectory(sub_dir));
base::FilePath inner_file = inner_dir.AppendASCII("inner");
base::FilePath outer_file = temp.path().AppendASCII("outer");
ASSERT_TRUE(file_util::WriteFile(outer_file, "X", 1));
@@ -128,7 +128,7 @@ TEST(ExtensionResourceTest, CreateWithAllResourcesOnDisk) {
// Create l10n resources (for current locale and its parents).
base::FilePath l10n_path =
temp.path().Append(kLocaleFolder);
- ASSERT_TRUE(file_util::CreateDirectory(l10n_path));
+ ASSERT_TRUE(base::CreateDirectory(l10n_path));
std::vector<std::string> locales;
l10n_util::GetParentLocales(l10n_util::GetApplicationLocale(std::string()),
@@ -137,7 +137,7 @@ TEST(ExtensionResourceTest, CreateWithAllResourcesOnDisk) {
for (size_t i = 0; i < locales.size(); i++) {
base::FilePath make_path;
make_path = l10n_path.AppendASCII(locales[i]);
- ASSERT_TRUE(file_util::CreateDirectory(make_path));
+ ASSERT_TRUE(base::CreateDirectory(make_path));
ASSERT_TRUE(file_util::WriteFile(make_path.AppendASCII(filename),
data.c_str(), data.length()));
}
diff --git a/extensions/common/file_util_unittest.cc b/extensions/common/file_util_unittest.cc
index 9ca883cc73..f8f7b622bd 100644
--- a/extensions/common/file_util_unittest.cc
+++ b/extensions/common/file_util_unittest.cc
@@ -56,13 +56,13 @@ TEST_F(FileUtilTest, ExtensionURLToRelativeFilePath) {
TEST_F(FileUtilTest, ExtensionResourceURLToFilePath) {
// Setup filesystem for testing.
base::FilePath root_path;
- ASSERT_TRUE(file_util::CreateNewTempDirectory(
+ ASSERT_TRUE(base::CreateNewTempDirectory(
base::FilePath::StringType(), &root_path));
root_path = base::MakeAbsoluteFilePath(root_path);
ASSERT_FALSE(root_path.empty());
base::FilePath api_path = root_path.Append(FILE_PATH_LITERAL("apiname"));
- ASSERT_TRUE(file_util::CreateDirectory(api_path));
+ ASSERT_TRUE(base::CreateDirectory(api_path));
const char data[] = "Test Data";
base::FilePath resource_path = api_path.Append(FILE_PATH_LITERAL("test.js"));
diff --git a/extensions/common/manifest_handlers/csp_info.cc b/extensions/common/manifest_handlers/csp_info.cc
index 65e3e9bc64..79f531a4f7 100644
--- a/extensions/common/manifest_handlers/csp_info.cc
+++ b/extensions/common/manifest_handlers/csp_info.cc
@@ -58,7 +58,7 @@ const std::string& CSPInfo::GetContentSecurityPolicy(
const Extension* extension) {
CSPInfo* csp_info = static_cast<CSPInfo*>(
extension->GetManifestData(keys::kContentSecurityPolicy));
- return csp_info ? csp_info->content_security_policy : EmptyString();
+ return csp_info ? csp_info->content_security_policy : base::EmptyString();
}
// static
diff --git a/extensions/common/permissions/api_permission.h b/extensions/common/permissions/api_permission.h
index 78fa428171..b234af1454 100644
--- a/extensions/common/permissions/api_permission.h
+++ b/extensions/common/permissions/api_permission.h
@@ -39,6 +39,7 @@ class APIPermission {
kActivityLogPrivate,
kAdView,
kAlarms,
+ kAlwaysOnTopWindows,
kAppCurrentWindowInternal,
kAppRuntime,
kAppWindow,
@@ -52,6 +53,7 @@ class APIPermission {
kBrailleDisplayPrivate,
kBrowsingData,
kCast,
+ kCastStreaming,
kChromeosInfoPrivate,
kClipboardRead,
kClipboardWrite,
@@ -158,7 +160,6 @@ class APIPermission {
kWebRequest,
kWebRequestBlocking,
kWebRequestInternal,
- kWebRtc,
kWebrtcAudioPrivate,
kWebrtcLoggingPrivate,
kWebstorePrivate,
@@ -169,6 +170,7 @@ class APIPermission {
kSystemNetwork,
kSystemInfoCpu,
kSystemInfoMemory,
+ kFirstRunPrivate,
kEnumBoundary
};
diff --git a/extensions/common/switches.cc b/extensions/common/switches.cc
index 82222c428d..5d50344671 100644
--- a/extensions/common/switches.cc
+++ b/extensions/common/switches.cc
@@ -34,12 +34,12 @@ const char kEnableExperimentalExtensionApis[] =
// them in the chrome:extensions page.
const char kErrorConsole[] = "error-console";
-// The time in seconds that an extension event page can be idle before it
+// The time in milliseconds that an extension event page can be idle before it
// is shut down.
const char kEventPageIdleTime[] = "event-page-idle-time";
-// The time in seconds that an extension event page has between being notified
-// of its impending unload and that unload happening.
+// The time in milliseconds that an extension event page has between being
+// notified of its impending unload and that unload happening.
const char kEventPageSuspendingTime[] = "event-page-unloading-time";
// Enables extensions running scripts on chrome:// URLs.
diff --git a/extensions/common/url_pattern.cc b/extensions/common/url_pattern.cc
index 78aa920ef7..5326f431ba 100644
--- a/extensions/common/url_pattern.cc
+++ b/extensions/common/url_pattern.cc
@@ -23,7 +23,7 @@ const char* kValidSchemes[] = {
content::kHttpScheme,
content::kHttpsScheme,
chrome::kFileScheme,
- chrome::kFtpScheme,
+ content::kFtpScheme,
chrome::kChromeUIScheme,
extensions::kExtensionScheme,
chrome::kFileSystemScheme,
diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp
index 21a80a8c48..96a0075357 100644
--- a/extensions/extensions.gyp
+++ b/extensions/extensions.gyp
@@ -205,6 +205,7 @@
'browser/process_map.h',
'browser/quota_service.cc',
'browser/quota_service.h',
+ 'browser/update_observer.h',
'browser/view_type_utils.cc',
'browser/view_type_utils.h',
],