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

Side by Side Diff: content/browser/web_contents/web_contents_impl.h

Issue 1730363003: Don't call WebContents::DownloadImage() callback if the WebContents were deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 10 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 | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('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 (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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 void AddDestructionObserver(WebContentsImpl* web_contents); 810 void AddDestructionObserver(WebContentsImpl* web_contents);
811 811
812 // Deletes and removes from the map a destruction observer 812 // Deletes and removes from the map a destruction observer
813 // watching |web_contents|. No-op if there is no such observer. 813 // watching |web_contents|. No-op if there is no such observer.
814 void RemoveDestructionObserver(WebContentsImpl* web_contents); 814 void RemoveDestructionObserver(WebContentsImpl* web_contents);
815 815
816 // Traverses all the RenderFrameHosts in the FrameTree and creates a set 816 // Traverses all the RenderFrameHosts in the FrameTree and creates a set
817 // all the unique RenderWidgetHostViews. 817 // all the unique RenderWidgetHostViews.
818 std::set<RenderWidgetHostView*> GetRenderWidgetHostViewsInTree(); 818 std::set<RenderWidgetHostView*> GetRenderWidgetHostViewsInTree();
819 819
820 // Called with the result of a DownloadImage() request.
821 void OnDidDownloadImage(const ImageDownloadCallback& callback,
822 int id,
823 const GURL& image_url,
824 image_downloader::DownloadResultPtr result);
825
820 // Callback function when showing JavaScript dialogs. Takes in a routing ID 826 // Callback function when showing JavaScript dialogs. Takes in a routing ID
821 // pair to identify the RenderFrameHost that opened the dialog, because it's 827 // pair to identify the RenderFrameHost that opened the dialog, because it's
822 // possible for the RenderFrameHost to be deleted by the time this is called. 828 // possible for the RenderFrameHost to be deleted by the time this is called.
823 void OnDialogClosed(int render_process_id, 829 void OnDialogClosed(int render_process_id,
824 int render_frame_id, 830 int render_frame_id,
825 IPC::Message* reply_msg, 831 IPC::Message* reply_msg,
826 bool dialog_was_suppressed, 832 bool dialog_was_suppressed,
827 bool success, 833 bool success,
828 const base::string16& user_input); 834 const base::string16& user_input);
829 835
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 // Manages media players, CDMs, and power save blockers for media. 1303 // Manages media players, CDMs, and power save blockers for media.
1298 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_; 1304 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_;
1299 1305
1300 scoped_ptr<RenderWidgetHostInputEventRouter> rwh_input_event_router_; 1306 scoped_ptr<RenderWidgetHostInputEventRouter> rwh_input_event_router_;
1301 1307
1302 PageImportanceSignals page_importance_signals_; 1308 PageImportanceSignals page_importance_signals_;
1303 1309
1304 bool page_scale_factor_is_one_; 1310 bool page_scale_factor_is_one_;
1305 1311
1306 base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_; 1312 base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_;
1313 base::WeakPtrFactory<WebContentsImpl> weak_factory_;
1307 1314
1308 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); 1315 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
1309 }; 1316 };
1310 1317
1311 // Dangerous methods which should never be made part of the public API, so we 1318 // Dangerous methods which should never be made part of the public API, so we
1312 // grant their use only to an explicit friend list (c++ attorney/client idiom). 1319 // grant their use only to an explicit friend list (c++ attorney/client idiom).
1313 class CONTENT_EXPORT WebContentsImpl::FriendZone { 1320 class CONTENT_EXPORT WebContentsImpl::FriendZone {
1314 private: 1321 private:
1315 friend class TestNavigationObserver; 1322 friend class TestNavigationObserver;
1316 friend class WebContentsAddedObserver; 1323 friend class WebContentsAddedObserver;
1317 friend class ContentBrowserSanityChecker; 1324 friend class ContentBrowserSanityChecker;
1318 1325
1319 FriendZone(); // Not instantiable. 1326 FriendZone(); // Not instantiable.
1320 1327
1321 // Adds/removes a callback called on creation of each new WebContents. 1328 // Adds/removes a callback called on creation of each new WebContents.
1322 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1329 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1323 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1330 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1324 1331
1325 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1332 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1326 }; 1333 };
1327 1334
1328 } // namespace content 1335 } // namespace content
1329 1336
1330 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1337 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698