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

Side by Side Diff: chrome/browser/extensions/script_executor.cc

Issue 15987009: Update chrome/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/script_executor.h" 5 #include "chrome/browser/extensions/script_executor.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "chrome/common/extensions/extension_messages.h" 10 #include "chrome/common/extensions/extension_messages.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 callback_.Run(kRendererDestroyed, -1, GURL(std::string()), val); 69 callback_.Run(kRendererDestroyed, -1, GURL(std::string()), val);
70 delete this; 70 delete this;
71 } 71 }
72 72
73 private: 73 private:
74 void OnExecuteCodeFinished(int request_id, 74 void OnExecuteCodeFinished(int request_id,
75 const std::string& error, 75 const std::string& error,
76 int32 on_page_id, 76 int32 on_page_id,
77 const GURL& on_url, 77 const GURL& on_url,
78 const base::ListValue& script_result) { 78 const base::ListValue& script_result) {
79 if (script_observers_ && error.empty()) { 79 if (script_observers_.get() && error.empty()) {
80 TabHelper::ScriptExecutionObserver::ExecutingScriptsMap id_map; 80 TabHelper::ScriptExecutionObserver::ExecutingScriptsMap id_map;
81 id_map[extension_id_] = std::set<std::string>(); 81 id_map[extension_id_] = std::set<std::string>();
82 FOR_EACH_OBSERVER(TabHelper::ScriptExecutionObserver, *script_observers_, 82 FOR_EACH_OBSERVER(TabHelper::ScriptExecutionObserver, *script_observers_,
83 OnScriptsExecuted(web_contents(), 83 OnScriptsExecuted(web_contents(),
84 id_map, 84 id_map,
85 on_page_id, 85 on_page_id,
86 on_url)); 86 on_url));
87 } 87 }
88 88
89 callback_.Run(error, on_page_id, on_url, script_result); 89 callback_.Run(error, on_page_id, on_url, script_result);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 params.all_frames = (frame_scope == ALL_FRAMES); 125 params.all_frames = (frame_scope == ALL_FRAMES);
126 params.run_at = static_cast<int>(run_at); 126 params.run_at = static_cast<int>(run_at);
127 params.in_main_world = (world_type == MAIN_WORLD); 127 params.in_main_world = (world_type == MAIN_WORLD);
128 params.is_web_view = is_web_view; 128 params.is_web_view = is_web_view;
129 129
130 // Handler handles IPCs and deletes itself on completion. 130 // Handler handles IPCs and deletes itself on completion.
131 new Handler(script_observers_, web_contents_, params, callback); 131 new Handler(script_observers_, web_contents_, params, callback);
132 } 132 }
133 133
134 } // namespace extensions 134 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_install_ui.cc ('k') | chrome/browser/extensions/unpacked_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698