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

Side by Side Diff: content/renderer/resource_fetcher_browsertest.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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 | « content/renderer/render_view_impl.h ('k') | extensions/browser/api/alarms/alarm_manager.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 (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 #include "content/public/renderer/resource_fetcher.h" 5 #include "content/public/renderer/resource_fetcher.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 timed_out_ = true; 86 timed_out_ = true;
87 if (!completed_) 87 if (!completed_)
88 quit_task_.Run(); 88 quit_task_.Run();
89 FAIL() << "fetch timed out"; 89 FAIL() << "fetch timed out";
90 } 90 }
91 91
92 static FetcherDelegate* instance_; 92 static FetcherDelegate* instance_;
93 93
94 private: 94 private:
95 base::OneShotTimer<FetcherDelegate> timer_; 95 base::OneShotTimer timer_;
96 bool completed_; 96 bool completed_;
97 bool timed_out_; 97 bool timed_out_;
98 WebURLResponse response_; 98 WebURLResponse response_;
99 std::string data_; 99 std::string data_;
100 base::Closure quit_task_; 100 base::Closure quit_task_;
101 }; 101 };
102 102
103 FetcherDelegate* FetcherDelegate::instance_ = NULL; 103 FetcherDelegate* FetcherDelegate::instance_ = NULL;
104 104
105 class EvilFetcherDelegate : public FetcherDelegate { 105 class EvilFetcherDelegate : public FetcherDelegate {
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 ASSERT_TRUE(test_server()->Start()); 381 ASSERT_TRUE(test_server()->Start());
382 GURL url(test_server()->GetURL("echoheader?header")); 382 GURL url(test_server()->GetURL("echoheader?header"));
383 383
384 PostTaskToInProcessRendererAndWait( 384 PostTaskToInProcessRendererAndWait(
385 base::Bind( 385 base::Bind(
386 &ResourceFetcherTests::ResourceFetcherSetHeader, 386 &ResourceFetcherTests::ResourceFetcherSetHeader,
387 base::Unretained(this), url)); 387 base::Unretained(this), url));
388 } 388 }
389 389
390 } // namespace content 390 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | extensions/browser/api/alarms/alarm_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698