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

Side by Side Diff: chrome/browser/chrome_quota_permission_context.cc

Issue 7640020: Browser should not crash when a page showing a quota infobar is closed/reloaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « no previous file | 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chrome_quota_permission_context.h" 5 #include "chrome/browser/chrome_quota_permission_context.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 30 matching lines...) Expand all
41 const std::string& display_languages, 41 const std::string& display_languages,
42 PermissionCallback* callback) 42 PermissionCallback* callback)
43 : ConfirmInfoBarDelegate(tab_contents), 43 : ConfirmInfoBarDelegate(tab_contents),
44 context_(context), 44 context_(context),
45 origin_url_(origin_url), 45 origin_url_(origin_url),
46 display_languages_(display_languages), 46 display_languages_(display_languages),
47 requested_quota_(requested_quota), 47 requested_quota_(requested_quota),
48 callback_(callback) {} 48 callback_(callback) {}
49 49
50 private: 50 private:
51 virtual ~RequestQuotaInfoBarDelegate() { 51 virtual ~RequestQuotaInfoBarDelegate() {}
52 // Make sure we've dispatched the callback.
53 DCHECK(!callback_.get());
michaeln 2011/08/15 17:51:05 The fact that we're tripping on this DCHECK indica
54 }
55 52
56 virtual bool ShouldExpire( 53 virtual bool ShouldExpire(
57 const content::LoadCommittedDetails& details) 54 const content::LoadCommittedDetails& details)
58 const OVERRIDE { 55 const OVERRIDE {
59 return false; 56 return false;
60 } 57 }
61 virtual string16 GetMessageText() const OVERRIDE; 58 virtual string16 GetMessageText() const OVERRIDE;
62 virtual void InfoBarDismissed() OVERRIDE; 59 virtual void InfoBarDismissed() OVERRIDE;
63 virtual bool Accept() OVERRIDE; 60 virtual bool Accept() OVERRIDE;
64 virtual bool Cancel() OVERRIDE; 61 virtual bool Cancel() OVERRIDE;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { 154 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
158 BrowserThread::PostTask( 155 BrowserThread::PostTask(
159 BrowserThread::IO, FROM_HERE, 156 BrowserThread::IO, FROM_HERE,
160 NewRunnableMethod( 157 NewRunnableMethod(
161 this, &ChromeQuotaPermissionContext::DispatchCallbackOnIOThread, 158 this, &ChromeQuotaPermissionContext::DispatchCallbackOnIOThread,
162 callback.release(), response)); 159 callback.release(), response));
163 return; 160 return;
164 } 161 }
165 callback->Run(response); 162 callback->Run(response);
166 } 163 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698