Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: extensions/renderer/user_script_set_manager.cc

Issue 481433005: Extensions: Move id_util functions to crx_file component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert last patchset. function returns Extension* and can't use an assert. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « extensions/extensions.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/renderer/user_script_set_manager.h" 5 #include "extensions/renderer/user_script_set_manager.h"
6 6
7 #include "components/crx_file/id_util.h"
7 #include "content/public/renderer/render_thread.h" 8 #include "content/public/renderer/render_thread.h"
8 #include "extensions/common/extension_messages.h" 9 #include "extensions/common/extension_messages.h"
9 #include "extensions/renderer/dispatcher.h" 10 #include "extensions/renderer/dispatcher.h"
10 #include "extensions/renderer/user_script_set.h" 11 #include "extensions/renderer/user_script_set.h"
11 #include "ipc/ipc_message.h" 12 #include "ipc/ipc_message.h"
12 #include "ipc/ipc_message_macros.h" 13 #include "ipc/ipc_message_macros.h"
13 #include "third_party/WebKit/public/web/WebFrame.h" 14 #include "third_party/WebKit/public/web/WebFrame.h"
14 15
15 namespace extensions { 16 namespace extensions {
16 17
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const ExtensionId& extension_id, 77 const ExtensionId& extension_id,
77 const std::set<std::string>& changed_extensions) { 78 const std::set<std::string>& changed_extensions) {
78 if (!base::SharedMemory::IsHandleValid(shared_memory)) { 79 if (!base::SharedMemory::IsHandleValid(shared_memory)) {
79 NOTREACHED() << "Bad scripts handle"; 80 NOTREACHED() << "Bad scripts handle";
80 return; 81 return;
81 } 82 }
82 83
83 for (std::set<std::string>::const_iterator iter = changed_extensions.begin(); 84 for (std::set<std::string>::const_iterator iter = changed_extensions.begin();
84 iter != changed_extensions.end(); 85 iter != changed_extensions.end();
85 ++iter) { 86 ++iter) {
86 if (!Extension::IdIsValid(*iter)) { 87 if (!crx_file::id_util::IdIsValid(*iter)) {
87 NOTREACHED() << "Invalid extension id: " << *iter; 88 NOTREACHED() << "Invalid extension id: " << *iter;
88 return; 89 return;
89 } 90 }
90 } 91 }
91 92
92 UserScriptSet* scripts = NULL; 93 UserScriptSet* scripts = NULL;
93 if (!extension_id.empty()) { 94 if (!extension_id.empty()) {
94 // The expectation when there is an extensions that "owns" this shared 95 // The expectation when there is an extensions that "owns" this shared
95 // memory region is that it will list itself as the only changed extension. 96 // memory region is that it will list itself as the only changed extension.
96 CHECK(changed_extensions.size() == 1 && 97 CHECK(changed_extensions.size() == 1 &&
(...skipping 22 matching lines...) Expand all
119 120
120 if (scripts->UpdateUserScripts(shared_memory, *effective_extensions)) { 121 if (scripts->UpdateUserScripts(shared_memory, *effective_extensions)) {
121 FOR_EACH_OBSERVER( 122 FOR_EACH_OBSERVER(
122 Observer, 123 Observer,
123 observers_, 124 observers_,
124 OnUserScriptsUpdated(*effective_extensions, scripts->scripts())); 125 OnUserScriptsUpdated(*effective_extensions, scripts->scripts()));
125 } 126 }
126 } 127 }
127 128
128 } // namespace extensions 129 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/extensions.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698