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 #include "webkit/support/weburl_loader_mock_factory.h" | 5 #include "webkit/support/weburl_loader_mock_factory.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" |
8 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
9 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
11 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" |
12 #include "webkit/support/weburl_loader_mock.h" | 13 #include "webkit/support/weburl_loader_mock.h" |
13 | 14 |
14 using WebKit::WebData; | 15 using WebKit::WebData; |
15 using WebKit::WebString; | 16 using WebKit::WebString; |
16 using WebKit::WebURL; | 17 using WebKit::WebURL; |
17 using WebKit::WebURLError; | 18 using WebKit::WebURLError; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 scoped_array<char> buffer(new char[size]); | 128 scoped_array<char> buffer(new char[size]); |
128 data->reset(); | 129 data->reset(); |
129 int read_count = file_util::ReadFile(file_path, buffer.get(), size); | 130 int read_count = file_util::ReadFile(file_path, buffer.get(), size); |
130 if (read_count == -1) | 131 if (read_count == -1) |
131 return false; | 132 return false; |
132 DCHECK(read_count == size); | 133 DCHECK(read_count == size); |
133 data->assign(buffer.get(), size); | 134 data->assign(buffer.get(), size); |
134 | 135 |
135 return true; | 136 return true; |
136 } | 137 } |
OLD | NEW |