| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Implements the Chrome Extensions Cookies API. | 5 // Implements the Chrome Extensions Cookies API. |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_cookies_api.h" | 7 #include "chrome/browser/extensions/extension_cookies_api.h" |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 URLRequestContextGetter* store_context = NULL; | 402 URLRequestContextGetter* store_context = NULL; |
| 403 if (!ParseStoreContext(details, &store_context, NULL)) | 403 if (!ParseStoreContext(details, &store_context, NULL)) |
| 404 return false; | 404 return false; |
| 405 DCHECK(store_context); | 405 DCHECK(store_context); |
| 406 | 406 |
| 407 // We don't bother to synchronously wait for the result here, because | 407 // We don't bother to synchronously wait for the result here, because |
| 408 // CookieMonster is only ever accessed on the IO thread, so any other accesses | 408 // CookieMonster is only ever accessed on the IO thread, so any other accesses |
| 409 // should happen after this. | 409 // should happen after this. |
| 410 bool rv = BrowserThread::PostTask( | 410 bool rv = BrowserThread::PostTask( |
| 411 BrowserThread::IO, FROM_HERE, | 411 BrowserThread::IO, FROM_HERE, |
| 412 new RemoveCookieTask(url, name, store_context)); | 412 new RemoveCookieTask(url, name, make_scoped_refptr(store_context))); |
| 413 DCHECK(rv); | 413 DCHECK(rv); |
| 414 | 414 |
| 415 return true; | 415 return true; |
| 416 } | 416 } |
| 417 | 417 |
| 418 void RemoveCookieFunction::Run() { | 418 void RemoveCookieFunction::Run() { |
| 419 SendResponse(RunImpl()); | 419 SendResponse(RunImpl()); |
| 420 } | 420 } |
| 421 | 421 |
| 422 bool GetAllCookieStoresFunction::RunImpl() { | 422 bool GetAllCookieStoresFunction::RunImpl() { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 extension_cookies_helpers::CreateCookieStoreValue( | 459 extension_cookies_helpers::CreateCookieStoreValue( |
| 460 incognito_profile, incognito_tab_ids.release())); | 460 incognito_profile, incognito_tab_ids.release())); |
| 461 } | 461 } |
| 462 result_.reset(cookie_store_list); | 462 result_.reset(cookie_store_list); |
| 463 return true; | 463 return true; |
| 464 } | 464 } |
| 465 | 465 |
| 466 void GetAllCookieStoresFunction::Run() { | 466 void GetAllCookieStoresFunction::Run() { |
| 467 SendResponse(RunImpl()); | 467 SendResponse(RunImpl()); |
| 468 } | 468 } |
| OLD | NEW |