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

Side by Side Diff: extensions/browser/extension_function_dispatcher.cc

Issue 664933004: Standardize usage of virtual/override/final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « extensions/browser/extension_function.cc ('k') | extensions/browser/extension_host.h » ('j') | 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/browser/extension_function_dispatcher.h" 5 #include "extensions/browser/extension_function_dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_string_value_serializer.h" 8 #include "base/json/json_string_value_serializer.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 UIThreadResponseCallbackWrapper( 145 UIThreadResponseCallbackWrapper(
146 const base::WeakPtr<ExtensionFunctionDispatcher>& dispatcher, 146 const base::WeakPtr<ExtensionFunctionDispatcher>& dispatcher,
147 RenderViewHost* render_view_host) 147 RenderViewHost* render_view_host)
148 : content::WebContentsObserver( 148 : content::WebContentsObserver(
149 content::WebContents::FromRenderViewHost(render_view_host)), 149 content::WebContents::FromRenderViewHost(render_view_host)),
150 dispatcher_(dispatcher), 150 dispatcher_(dispatcher),
151 render_view_host_(render_view_host), 151 render_view_host_(render_view_host),
152 weak_ptr_factory_(this) { 152 weak_ptr_factory_(this) {
153 } 153 }
154 154
155 virtual ~UIThreadResponseCallbackWrapper() { 155 ~UIThreadResponseCallbackWrapper() override {}
156 }
157 156
158 // content::WebContentsObserver overrides. 157 // content::WebContentsObserver overrides.
159 virtual void RenderViewDeleted( 158 void RenderViewDeleted(RenderViewHost* render_view_host) override {
160 RenderViewHost* render_view_host) override {
161 DCHECK_CURRENTLY_ON(BrowserThread::UI); 159 DCHECK_CURRENTLY_ON(BrowserThread::UI);
162 if (render_view_host != render_view_host_) 160 if (render_view_host != render_view_host_)
163 return; 161 return;
164 162
165 if (dispatcher_.get()) { 163 if (dispatcher_.get()) {
166 dispatcher_->ui_thread_response_callback_wrappers_ 164 dispatcher_->ui_thread_response_callback_wrappers_
167 .erase(render_view_host); 165 .erase(render_view_host);
168 } 166 }
169 167
170 delete this; 168 delete this;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 462
465 // static 463 // static
466 void ExtensionFunctionDispatcher::SendAccessDenied( 464 void ExtensionFunctionDispatcher::SendAccessDenied(
467 const ExtensionFunction::ResponseCallback& callback) { 465 const ExtensionFunction::ResponseCallback& callback) {
468 base::ListValue empty_list; 466 base::ListValue empty_list;
469 callback.Run(ExtensionFunction::FAILED, empty_list, 467 callback.Run(ExtensionFunction::FAILED, empty_list,
470 "Access to extension API denied."); 468 "Access to extension API denied.");
471 } 469 }
472 470
473 } // namespace extensions 471 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_function.cc ('k') | extensions/browser/extension_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698