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

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

Issue 306032: Simplify threading in browser thread by making only ChromeThread deal with di... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: a few more simplifications Created 11 years, 1 month 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/autoupdate_interceptor.h" 5 #include "chrome/browser/extensions/autoupdate_interceptor.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "chrome/browser/chrome_thread.h" 8 #include "chrome/browser/chrome_thread.h"
9 #include "net/url_request/url_request_test_job.h" 9 #include "net/url_request/url_request_test_job.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 GURL gurl(url); 61 GURL gurl(url);
62 EXPECT_EQ("http", gurl.scheme()); 62 EXPECT_EQ("http", gurl.scheme());
63 EXPECT_EQ("localhost", gurl.host()); 63 EXPECT_EQ("localhost", gurl.host());
64 EXPECT_TRUE(file_util::PathExists(path)); 64 EXPECT_TRUE(file_util::PathExists(path));
65 responses_[gurl] = path; 65 responses_[gurl] = path;
66 } 66 }
67 67
68 68
69 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url, 69 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url,
70 const FilePath& path) { 70 const FilePath& path) {
71 MessageLoop* io_loop = ChromeThread::GetMessageLoop(ChromeThread::IO); 71 ChromeThread::PostTask(
72 io_loop->PostTask(FROM_HERE, 72 ChromeThread::IO, FROM_HERE,
73 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, 73 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, url, path));
74 url, path));
75 } 74 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698